package com.yyh.photo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
@EnableSwagger2
public class PhotoApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(PhotoApplication.class, args);

        Environment env = applicationContext.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        System.out.println("*******************************");
        System.out.println("");
        System.out.println("");
        System.out.println("建信金科安全测试===========系统服务生成启动成功\n\t");
        System.out.println("----------------------------------------------------------");
        System.out.println("访问地址:http://" + ip + ":" + port + ((path == null || path =="") ? "":path));
        System.out.println("----------------------------------------------------------");
        System.out.println("");
        System.out.println("");

        System.out.println("*******************************");
    }

}
